const { merge } = require('webpack-merge')
const baseConfig = require('./config')
const TerserPlugin = require("terser-webpack-plugin");

module.exports = merge(baseConfig, {
  mode: 'development',
//   devtool: 'eval-cheap-source-map',
  output: {
    chunkFilename: 'js/[name].chunk.js',
  },
  devServer: {
    client: {
      logging: 'error',
    },
    hot: true,
  },
    optimization: {
        minimizer: [
            new TerserPlugin({
                terserOptions: {
                    ecma: 5, // 强制使用 ES5
                }
            })
        ]
    },
})
